<?php
/**
 * Created by openXtiger.org.
 * User: xtiger
 * Date: 2009-6-20
 * Time: 11:43:44
 */
function cachemodel_reflashRoles($configAttributes = NULL){
    if(empty($configAttributes))
        $configAttributes = xt_load('cache','securitySource');
    $roles = xt_load('cache','roles');
    foreach($roles as $id=>$r) {
        $roles[$id][2] = 0;
    }

    foreach($configAttributes as $key=>$v) {
        if($key=='allowIfAbstainDecision') {
            continue;
        }
        foreach($v as $v1) {
            foreach($roles as $id=>$r) {
                if((intval($r[0]) & $v1)>0 ) $roles[$id][2]++;
            }
        }
    }
    xt_save('cache','roles',$roles);
}

?>